package com.wjw.java.others.interface_;

/**
 * 演示接口的多态传递现象：
 */
public class InterfacePolyPass {
    public static void main(String[] args) {
        UserService userService = new UserServiceImpl();
        userService.say();
        //如果UserService没有extends PersonService,下面代码就会报错
        PersonService personService = new UserServiceImpl();
        personService.say();
    }
}
interface PersonService{
    public void say();
}
interface UserService extends PersonService{

}
class UserServiceImpl implements UserService{

    @Override
    public void say() {
        System.out.println("你好啊!!!");
    }
}